/**
 * Created by My Company.
 * User: loitran
 * Date: Apr 12, 2012
 * Time: 9:50:14 PM
 * com.mycompany.inventory.pojo.
 */
package com.mycompany.inventory.pojo;

import java.io.Serializable;

/**
 * @author loitran
 *
 */
public class MediaDTO implements Serializable {
	private Integer id;
	private String productId;
	private String name;
	private String mimeType;
	private Integer size;
	private byte[] object;
	private String format;
	
	public MediaDTO()
    {
        super();
    }
	
	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the productId
	 */
	public String getProductId() {
		return productId;
	}

	/**
	 * @param productId the productId to set
	 */
	public void setProductId(String productId) {
		this.productId = productId;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the mimeType
	 */
	public String getMimeType() {
		return mimeType;
	}

	/**
	 * @param mimeType the mimeType to set
	 */
	public void setMimeType(String mimeType) {
		this.mimeType = mimeType;
	}

	/**
	 * @return the size
	 */
	public Integer getSize() {
		return size;
	}

	/**
	 * @param size the size to set
	 */
	public void setSize(Integer size) {
		this.size = size;
	}

	/**
	 * @return the object
	 */
	public byte[] getObject() {
		return object;
	}

	/**
	 * @param object the object to set
	 */
	public void setObject(byte[] object) {
		this.object = object;
	}

	/**
	 * @return the format
	 */
	public String getFormat() {
		return format;
	}

	/**
	 * @param format the format to set
	 */
	public void setFormat(String format) {
		this.format = format;
	}

	public int compareTo( MediaDTO o )
    {
        if ( o == null )
            return 1;
        return getId().compareTo( o.getId() );
    }

    @Override
    public boolean equals( Object obj )
    {
        if ( obj == null || ( obj instanceof MediaDTO ) == false )
            return false;
        return getId().equals( ( ( MediaDTO )obj ).getId() );
    }

    @Override
    public String toString()
    {
        return getName();
    }	
}
